<link rel="stylesheet" type="text/css" href="css/accourt.css"/>
<link rel="stylesheet" href="css/trecord.css" media="all" />
<link rel="stylesheet" href="css/page.css" media="all" />
<script type="text/javascript" src="js/Calendar.js"></script>
<script type="text/javascript" src="js/global/Date_func.js"></script>
<style>
.tQ{width:180px;}
.tW{width:180px;}
</style>
<div class="r_content" id="spe_w">
	<h3 class="mc_title pageblock">
		<span class="mctit_1"><span class="mctit_2">联盟分润记录</span></span>        
	</h3>
	<div class="accoinfo accos">
		<form id="searchBox">
            <input type="hidden" name="act" id="act"/>
			<input type="hidden" name="timeT" id="timeT" value=""/>
			<input type="hidden" name="dtype" id="dtype" value="<?=$_REQUEST['dtype']?>"/>
			<input type="hidden" name="daction" id="daction" value="<?=$_REQUEST['daction']?>"/>
			<input type="hidden" name="about" id="about" value="<?=$about?>"/>
			<input type="hidden" name="account" id="account" value="<?=$_REQUEST['account']?>"/>
			<ul class="search">
				<li class="time">
					<span>起止日期：</span>
					<input type="text" name="beginDate" id="begintime" onmouseup="SelectDate(this,'yyyy-MM-dd',0,0)" value="<?=$_REQUEST['beginDate']?>"/>
					<label>至</label>
					<input type="text" name="endDate"  id="endtime" onmouseup="SelectDate(this,'yyyy-MM-dd',0,0)" value="<?=$_REQUEST['endDate']?>"/>
					<a title="today" class="<?=$_REQUEST['timeT']=="today"?"current":""?>">今天</a>
					<a title="yesterday" class="<?=$_REQUEST['timeT']=="yesterday"?"current":""?>">昨天</a>
					<a title="week" class="<?=$_REQUEST['timeT']=="week"?"current":""?>">本周</a>
					<a title="lastweek" class="<?=$_REQUEST['timeT']=="lastweek"?"current":""?>">上周</a>
					<a title="month" class="<?=$_REQUEST['timeT']=="month"?"current":""?>">本月</a>
					<a title="lastmonth" class="<?=$_REQUEST['timeT']=="lastmonth"?"current":""?>">上月</a>
					
				</li>
				<li class="skey">
					<span>交易类型：</span>
					<a class="<?=!isset($_REQUEST['dtype'])||($_REQUEST['dtype']==="")?"current":""?>" key="dtype" kvalue="">全部</a>
					<a class="<?=$_REQUEST['dtype']==='0'?"current":""?>" key="dtype" kvalue="0">下单</a>
					<a class="<?=$_REQUEST['dtype']==='1'?"current":""?>" key="dtype" kvalue="1">撤改</a>
                    <?if(!$access['yd']):?>
					<a class="<?=$_REQUEST['dtype']==='3'?"current":""?>" key="dtype" kvalue="3">充值/提现</a>
					<a class="<?=$_REQUEST['dtype']==='4'?"current":""?>" key="dtype" kvalue="4">授信/预存</a>
                    <a class="<?=$_REQUEST['dtype']==='6'?"current":""?>" key="dtype" kvalue="6">提现冻结</a>
                    <?endif;?>
					<a class="<?=$_REQUEST['dtype']==='5'?"current":""?>" key="dtype" kvalue="5">分润</a>                   
                    <a class="<?=$_REQUEST['dtype']==='15'?"current":""?>" key="dtype" kvalue="15">联盟分润</a>
				</li>
                <li class="skey">
                  <span >订单号：</span >
                  <input name='orderid' value="<?=$_GET['orderid']?>"/>
                  <!--<input type="button" class="export exportbtn" value="导出" id="excel"/>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
                </li>
                <li class="skey"><input type="submit" id="query" value="查询"/></li>
			</ul>
		</form>
	</div>
	<div class="acclist">
		<table class="acctab">
			<thead>
				<tr>
					<th class="tQ">交易商户</th>
					<th class="tW">交易时间</th>
					<th class="tE">订单号</th>
					<th class="tR">联盟身份</th>
					<th class="tT">收入</th>
				</tr>
			 </thead>
			 <tbody id="tbody">
                <?if($r[0]!=""){?>
				<?foreach($r as $row){$i++;?>
				<tr class="<?=($i%2==1)?"odd":"even"?>">
					<td class="tL"><span style="color:red">ID:<?=$row['id']?> </span><?=$dname[$row['id']]?> </td>
                    <td title="<?=$row['id']?>"><?=$row['rectime']?></td>
					<td><a target="_blank" href="orderView.html?ordernum=<?=$row['orderid']?>&from=sale"><?=$row['orderid']?></a></td>
					<td><?=$row['ID_case']?></td>
					<td class="lmoney tR"><?=$row['lmoney']/100?></td>
				</tr>
				<?}}?>
				<?if(count($r)==0&&$_REQUEST['account']!='all'){?>
					<tr><td colspan="8" style="text-align:left; padding-left:60px;">无资金流向记录</td></tr>
				<?}?>
			</tbody>
		</table>
		<?if(count($r)!=0){page($count,$currentPage,$pageSize);}?>
	</div>
</div>
<script>
$(".search li.time a").click(function(){
    var title=$(this).attr("title");
    Date_func.selectDate(title,document.getElementById("begintime"),document.getElementById("endtime"));
    $("#timeT").val(title)
    $("#searchBox").submit();
})
$(".search li.skey a").click(function(){
    var key=$(this).attr("key");
    $("#"+key).val($(this).attr("kvalue"));
    $("#searchBox").submit();
})
$("#excel").click(function(){
    $("#act").val("Export");
    $("#searchBox").submit();
    $("#act").val("");
});
</script>